package com.xiannimei.web;

import javax.servlet.http.Cookie;

public class TimeIntervalCookie extends Cookie {
	public static final int SECONDS_PER_YEAR = 60 * 60 * 24 * 365;
	public static final int SECONDS_PER_MONTH = 60 * 60 * 24 * 30;
	public static final int SECONDS_PER_WEEK = 60 * 60 * 24 * 7;
	public static final int SECONDS_PER_DAY = 60 * 60 * 24;
	public static final int SECONDS_PER_HOUR = 60 * 60;

    public TimeIntervalCookie(String name, String value) {
    	super(name, value);
        //setMaxAge(SECONDS_PER_YEAR);
        setPath("/");
    }
    
    public TimeIntervalCookie(String name, String value, int interval) {
        super(name, value);
        setMaxAge(interval);
        setPath("/");
    }
    
    public TimeIntervalCookie(String name, String value, int interval, String path) {
        super(name, value);
        setMaxAge(interval);
        setPath(path);
    }
}